﻿using BLL.Model.Base;

namespace System.Web.Mvc
{
    /// <summary>
    /// 扩展Controller方法
    /// </summary>
    public static class ControllerExtensions
    {
        /// <summary>
        /// 获取LoginUserInfo
        /// </summary>
        /// <param name="controller"></param>
        /// <returns></returns>
         public static LoginUserInfo GetLoginUser(this Controller controller)
         {
             var user = controller.User as UserPrincipal;
             return user == null ? null : user.UserInfo;
         }
    }
}